package com.mach.platform;

import com.mach.platform.service.AlarmMessageServiceImpl;
import com.mach.platform.service.IotSpaceServiceImpl;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
  * @Description: 启动程序
  *
  * @date  2018/5/22 0022   16:15
  * @author Administrator
  */
@SpringBootApplication
@EnableSwagger2
@EnableScheduling
@EnableCaching
@MapperScan("com.mach.platform.mapper")
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
public class Application implements ApplicationRunner {

    @Autowired
    private IotSpaceServiceImpl iotSpaceService;

    @Autowired
    AlarmMessageServiceImpl alarmMessageService;

	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}

    @Override
    public void run(ApplicationArguments args) {
        // 项目启动完成后执行
        iotSpaceService.configureSpaceLevelDataTask();

        //报警信息
//        alarmMessageService.alarmPreset();
    }
}
